package com.wang;

import com.wang.servlet.UserServlet;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.context.annotation.Bean;

/**
 * @Classname SpringBootDemo12Application
 * @Description TODO
 * @Date 2024/5/21 11:54
 * @Created by pc
 */
@SpringBootApplication
@ServletComponentScan("com.wang.servlet")
public class SpringBootDemo14Application {
    public static void main(String[] args) {
        SpringApplication.run(SpringBootDemo14Application.class,args);
    }

    @Bean
    public ServletRegistrationBean getServletRegistrationBean(){
        ServletRegistrationBean bean = new ServletRegistrationBean(new UserServlet(), "/user");
        bean.addInitParameter("name","张三");
        return bean;
    }
}
